import request from '@/utils/request'
import scope from './scope'
const apiPrefix = `${process.env.VUE_APP_BASE_API}/${scope}/sysorganize/`

// 部门管理
export const getOrgTree = (config = {}) => {
  return request.get(apiPrefix + 'gettree', config)
}

export const getOrgListPage = (params, config = {}) => {
  params = params || {}
  return request.get(apiPrefix + 'query', { params: params }, config)
}

export const removeOrg = (params, config = {}) => {
  return request.post(apiPrefix + 'delete', params, config)
}
export const addOrg = (params, config = {}) => {
  return request.post(apiPrefix + 'add', params, config)
}
export const editOrg = (params, config = {}) => {
  return request.post(apiPrefix + 'update', params, config)
}
export const getOrg = (params, config = {}) => {
  return request.get(apiPrefix + 'get', { params: params, ...config })
}
